<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!--分页-->
<div class="pager">
<c:if test="${page.curPage>1}">
	<span id="previous"><a href="${page.url}?curPage=${page.curPage-1}&kind=${kind}">上一页</a></span>
</c:if>
 <c:forEach var="pagenum" begin="${page.startPage}" end="${page.endPage}" >
 	<c:choose>
 		<c:when test="${page.curPage==pagenum}">
 			<span class="pager_n active"><a href="${page.url}?curPage=${pagenum}&kind=${kind}">${pagenum}</a></span>
 		</c:when>
 		<c:otherwise>
 			<span class="pager_n"><a href="${page.url}?curPage=${pagenum}&kind=${kind}">${pagenum}</a></span>
 		</c:otherwise>
 	</c:choose>
 </c:forEach>
<c:if test="${page.curPage<page.pageCount}">
	<span id="next"><a href="${page.url}?curPage=${page.curPage+1}&kind=${kind}">下一页</a></span>
</c:if>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$("div.pager").find("span.active a").css("background-color","#DFDFDF");
	$("div.pager").find("span.pager_n").click(function(){
		$("div.pager").find("span.active a").removeAttr("style");
		$("div.pager").find("span.active").removeClass("active");
		$(this).addClass("active");
		$("div.pager").find("span.active a").css("background-color","#DFDFDF");
		});
	
	$("div.pager").find("#previous").click(function(){
		$("div.pager").find("span.active").prev().addClass("active");
		$("div.pager").find("span.active").last().find("a").removeAttr("style");
		$("div.pager").find("span.active").last().removeClass("active");
		$("div.pager").find("span.active a").css("background-color","#DFDFDF");
	});
	
	$("div.pager").find("#next").click(function(){
		$("div.pager").find("span.active").next().addClass("active");
		$("div.pager").find("span.active").first().find("a").removeAttr("style");
		$("div.pager").find("span.active").first().removeClass("active");
		$("div.pager").find("span.active a").css("background-color","#DFDFDF");
	});
	
	});
</script>